// 详情页网络请求
import {request2} from './request'

export function getDetail(id) {
  return request2({
    url: '/playlist/detail',
    params: {
      id
    }
  })
}

export function getComments(id) {
  return request2({
    url: '/comment/playlist',
    params: {
      id
    }
  })
}

export function getRecommends() {
  return request2({
    url: '/personalized'
  })
}

export class PlayList {
  constructor(playlist) {
    this.name = playlist.name
    this.description = playlist.description
    this.playCount = playlist.playCount
    this.subscribedCount = playlist.subscribedCount
    this.shareCount = playlist.shareCount
    this.tags = playlist.tags
  }
}

export class Creator {
  constructor(creator) {
    this.avatarUrl = creator.avatarUrl
    this.nickname = creator.nickname
  }
}

// 构造函数
/* class Person {
  constructor(name, age) {
    this.name = name
    this.age = age
  }
}

const p = new Person('why', 18) */

/* // 判断对象是否为空对象
const obj = {

}

Object.keys(obj).length === 0 */